package com.btkjgc.sms;

import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo_Mt
{
	public static void main(String[] args) throws UnsupportedEncodingException
	{
		// String content = "还是地方";
		// Client client = new Client(Constant.SN, Constant.PWD);
		// if (content.contains("&"))
		// {
		// content = content.replace("&", "&amp;");
		// }
		// if (content.contains("<"))
		// {
		// content = content.replace("<", "&lt;");
		// }
		// if (content.contains(">"))
		// {
		// content = content.replace(">", "&gt;");
		// }
		// String result_mt = client.mt("15158183117", content, "", "", "");
		// System.out.println(result_mt);
		MessageGateway messageGateway = new MessageGateway();
		SimpleDateFormat formator = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

		String hostName = "";
		try
		{
			InetAddress addr = InetAddress.getLocalHost();
			hostName = addr.getHostName() + "(" + addr.getHostAddress() + ")";
		}
		catch (UnknownHostException e)
		{
			e.printStackTrace();
		}
		messageGateway.sendMessage("15158183117", "部署在" + hostName + "上的应用服务器于"
				+ formator.format(new Date()) + "启动");
	}
}
